package com.scs.application.modules.dept.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.scs.application.core.entity.FlowEntity;
import com.scs.application.modules.upgrade.db.annotation.EntityClassAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityFieldAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityIndexAnnotation;
import com.scs.application.modules.upgrade.db.enums.EntityFieldType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;
/**
 * <p>
 *
 * </p>
 *
 */
@Data
@Accessors(chain = true)
@EntityClassAnnotation(remark = "病人消耗表")
@TableName("dept_oprt_use")
@EntityIndexAnnotation(ux = {"bus_key"},ix = {"flow_status","flow_modified"})
public class OprtUse extends FlowEntity {

    @EntityFieldAnnotation(
            text = "消耗单编号",
            length = "255",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String busKey;

    @EntityFieldAnnotation(
            text = "单据类型",
            length = "20",
            not_null = false,
            default_value = "MANUAL",
            comment = ""
    )
    private String busType;

    @EntityFieldAnnotation(
            text = "是否冲红消耗单0:否 1：是",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Integer flagUseRedType;

    @EntityFieldAnnotation(
            text = "手术日期",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    @TableField(strategy = FieldStrategy.IGNORED)
    private Date oprtDate;

    @EntityFieldAnnotation(
            text = "手术单号",
            length = "100",
            not_null = false,
            default_value = "",
            comment = ""
    )
    @TableField(strategy = FieldStrategy.IGNORED)
    private String oprtCode;

    @TableField(exist = false)
    private String mergeId;

    @EntityFieldAnnotation(
            text = "消耗日期",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Date busDate;

    @EntityFieldAnnotation(
            text = "手术id",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    @TableField(strategy = FieldStrategy.IGNORED)
    private String oprtId;

    @EntityFieldAnnotation(
            text = "手术名称",
            length = "200",
            not_null = false,
            default_value = "",
            comment = ""
    )
    @TableField(strategy = FieldStrategy.IGNORED)
    private String oprtName;

    @EntityFieldAnnotation(
            text = "患者id",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    @TableField(strategy = FieldStrategy.IGNORED)
    private String patientId;

    @EntityFieldAnnotation(
            text = "患者名称",
            length = "20",
            not_null = false,
            default_value = "",
            comment = ""
    )
    @TableField(strategy = FieldStrategy.IGNORED)
    private String patientName;

    @EntityFieldAnnotation(
            text = "患者年龄",
            length = "10",
            not_null = false,
            default_value = "",
            comment = ""
    )
    @TableField(strategy = FieldStrategy.IGNORED)
    private Integer patientAge;

    @EntityFieldAnnotation(
            text = "住院编号",
            length = "50",
            not_null = false,
            default_value = "",
            comment = ""
    )
    @TableField(strategy = FieldStrategy.IGNORED)
    private String patientNo;

    @EntityFieldAnnotation(
            text = "床位号",
            length = "50",
            not_null = false,
            default_value = "",
            comment = ""
    )
    @TableField(strategy = FieldStrategy.IGNORED)
    private String bedNo;

    @EntityFieldAnnotation(
            text = "主治医生",
            length = "20",
            not_null = false,
            default_value = "",
            comment = ""
    )
    @TableField(strategy = FieldStrategy.IGNORED)
    private String docNameSug;

    @EntityFieldAnnotation(
            text = "申请医生",
            length = "20",
            not_null = false,
            default_value = "",
            comment = ""
    )
    @TableField(strategy = FieldStrategy.IGNORED)
    private String docNameApply;

    @EntityFieldAnnotation(
            text = "消耗科室",
            type = EntityFieldType.LONG,
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String deptId;

    @EntityFieldAnnotation(
            text = "消耗科室",
            length = "50",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String deptName;

    @EntityFieldAnnotation(
            text = "执行科室ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = "比如手术室，导管室"
    )
    @TableField(strategy = FieldStrategy.IGNORED)
    private String execDeptId;

    @EntityFieldAnnotation(
            text = "执行科室名称",
            length = "50",
            not_null = false,
            default_value = "",
            comment = ""
    )
    @TableField(strategy = FieldStrategy.IGNORED)
    private String execDeptName;

    @EntityFieldAnnotation(
            text = "关联key",
            length = "50",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String refKey;

    @EntityFieldAnnotation(
            text = "关联table",
            length = "50",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String refTable;

    @EntityFieldAnnotation(
            text = "金额",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Double amount;

    @EntityFieldAnnotation(
            text = "库存地ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = true,
            default_value = "",
            comment = "库存地ID"
    )
    private String warehouseId;

    @EntityFieldAnnotation(
            text = "库存地全称",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "库存地全称"
    )
    private String warehouseName;


    @EntityFieldAnnotation(
            text = "住院号",
            length = "50",
            default_value = "",
            comment = "患者住院唯一标识"
    )
    @TableField(strategy = FieldStrategy.IGNORED)
    private String inpatientNo;

    @EntityFieldAnnotation(
            text = "门诊号",
            length = "50",
            default_value = "",
            comment = "患者门诊唯一标识"
    )
    @TableField(strategy = FieldStrategy.IGNORED)
    private String outpatientNo;

    @EntityFieldAnnotation(
            text = "备注",
            length = "200",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String remark;
    @EntityFieldAnnotation(
            text = "冲红单号",
            length = "200",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String refOprtBusKey;

    @EntityFieldAnnotation(
            text = "是否推送成功 0:否 1：是",
            length = "",
            not_null = false,
            default_value = "0",
            comment = "推送标志"
    )
    private Integer flagPushed;

    @EntityFieldAnnotation(
            text = "推送时间 ",
            length = "",
            not_null = false,
            comment = "推送时间"
    )
    private Date gmtPushed;

    @EntityFieldAnnotation(
            text = "HIS生成日期",
            length = "",
            not_null =false,
            default_value = "",
            comment = ""
    )
    private Date mdate;

    /**
    * @Description： 单品数量合计
    */
   @TableField(exist = false)
    private String skuQtySum;


    // 明细数量
    @TableField(exist = false)
    private int countDtl;

}
